﻿using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Base;

namespace Marmat.Forms.Views.Grid
{
    public class RowStyleEventArgs : GridEventArgs
    {
        internal DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs Info;

        internal RowStyleEventArgs(BaseGrid gridControl, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs Info) : base(gridControl)
        {
            this.Info = Info;
        }

        /// <summary>
        /// 获取或设置DevExpress.XtraGrid.Views.Grid.GridView.RowStyle提供的外观设置，
        /// 事件具有比DevExpress.XtraGrid.Views.Grid.GridViewAppearances.EvenRow和DevExpress.XtraGrid.Views.Grid.GridViewAppearances.OddRow指定的外观更高的优先级。
        /// </summary>
        /// <returns></returns>
        public bool HighPriority
        {
            get
            {
                return this.Info.HighPriority;
            }

            set
            {
                this.Info.HighPriority = value;
            }
        }

        /// <summary>
        /// 获取已处理行的当前状态。
        /// </summary>
        /// <returns></returns>
        public GridRowCellState State
        {
            get
            {
                return this.Info.State;
            }
        }

        /// <summary>
        /// 获取用于在当前处理的行中绘制单元格的外观设置。
        /// </summary>
        /// <returns></returns>
        public AppearanceObject Appearance
        {
            get
            {
                return this.Info.Appearance;
            }
        }

        /// <summary>
        /// 复制作为参数传递的外观对象的激活设置。
        /// </summary>
        /// <param name="appearance">一个DevExpress.Utils。表示操作源的appearance对象。</param>
        public void CombineAppearance(AppearanceObject appearance)
        {
            this.Info.CombineAppearance(appearance);
        }

        /// <summary>
        /// 获取当前行的行号。
        /// </summary>
        /// <returns></returns>
        public int RowHandle
        {
            get
            {
                return this.Info.RowHandle;
            }
        }
    }
}